Field of Invention
The present invention relates generally to advanced control and advanced manufacturing, specifically to a real-time kernel of open CNC systems and a real-time control method of tool-paths.
Description of Related Arts
The architecture of open CNC systems defined by the IEEE is based on a real-time operating system (RTOS).
Under the real-time operating system, the management mechanism for internal/external resources and contingency mechanism for the internal/external environment changes are tightly coupled together with computation rules of iterative interpolation control algorithm, and a universal control method is formed, that is the iterative interpolation method. The real-time operating system thus becomes the real-time control center of a real-time interpolation iterative process.
The iterative interpolation control method has run through the overall history of CNC technology since the 1970s, and has created the “interpolation era” of CNC systems.
Before the 1970s, the computers are basically only used in the field of scientific computation, its facing problem is to manage application programs for multiple users, and the operating system oriented multi-user is resulted. In the 1980s, computers are widely used in real-time control of the production process. In order to solve the real-time of operating system, a real-time kernel is embedded in the usual multi-user time-sharing operating system, and that is real-time operating system. For example, in the PC, for Windows and Linux, RTX and RTLinux are widely used real-time kernels.
Literature “CNC principles, systems and applications PC-based” (author: Zhou Kai, Machinery Industry Press in July 2007 1st Edition •2nd printing) pointed out that the real-time kernel is a core of CNC software systems for the existing PC-based open CNC systems. Architecture, design and operation management of CNC software systems, for example, “multi-tasking software design by means of multi-process and multi-threading”, “real-time software design with real-time and reliability”, “coordinated operation and information exchange between real-time software and non-real-time software” and so on, are dependent on the real-time kernel.
The “Technical Committee of Open Systems” of IEEE defines an open system as follows: “An open system provides capabilities that enable property implemented applications to run on a variety of platforms from multiple vendors, interoperate with other system applications and present a consistent style of interaction with the user” (IEEE 1003.0).
The Chinese National Standard “GB/T 18759.1-2002 mechanical and electrical equipment •open CNC systems—Part 1: General Principles •3.1” seizes the nature of the IEEE definition and follows its basic principle, the openness is straightforwardly defined as “plug-and-play” of application software, its definition of the open CNC systems is as follows: “An open CNC system runs on a system platform constructed according to the principles such as the publicity, scalability and compatibility, and possess the portability, interoperability and consistency of human-machine interface.”
These definitions mean that the architecture of the existing open CNC system is completely computerized by the IEEE. Therefore, the open CNC system is configured a general-purpose computer system with a real-time operating system, and CNC software system is merely the special application software.
The essential of real-time is timing predictability, it means that running time of all tasks are predictable under the operating system, that is, the real-time is the ability of the operating system to respond and handle external events in the foreseeable time. Therefore, the so-called real-time kernel, operating system and necessarily involves the process scheduling/thread scheduling related precision clock management, multi-level nested interrupt management, communication and synchronization of the basic functions of low-level hardware-dependent task scheduling. In other words, the real-time kernel in the existing open CNC system is not aimed at the specific real-time control process, but aimed at the contingency mechanism of operating system to respond and handle the internal/external environment changes.
In fact, due to the complexity of industrial environment, differences between real-time processes are great. For different real-time processes, a uniform contingency mechanism violated the rule of “making a concrete analysis of concrete conditions”, it inevitably spends a lot of computing resources and reduces efficiency. For numerical control, as the core of the CNC software system, the above real-time kernel also has the following problems.
In the real-time kernel, the key technology is scheduling/thread scheduling. The real-time complicates process scheduling, and parallel algorithm further complicates process scheduling. More troublesome is the thread scheduling. Compared with the concurrency of the pipeline in machine instruction level and concurrency of process scheduling in processor-level, the uncertainty of the concurrency of thread scheduling is extremely complex. Process and thread, plus parallel algorithm, it leads to highly complicate the real-time operating system, and further to highly complicate the CNC software system. For a multi-axis control with high-speed and high-precision, the CNC software system is certainly a large and complex system it use parallel algorithm, multi-process scheduling/multi-thread scheduling, multi-nested calls, and multi-nested real time interrupts. In order to develop this vast and complex interrupt system, it is necessary to be proficient in digital control technology, but also proficient in computer software and hardware architecture, but also proficient in parallel algorithm and multi-thread programming. This means that the CNC software system is to become so-called system by experts, that is a system to be developed only by experts proficient in the above techniques, and users can not secondary develop, thus the CNC system completely lost openness.
The real-time operating system is very complex, therein is a lot of hidden potential vulnerabilities. The problem is, no one can fully understand an operating system. Thus, these vulnerabilities often require ten or more years to repair, and it is difficult to completely eliminate. Statistical data indicate that for the reliability of computer system, hardware error is only a few percent, the vast majority of errors from the system management. Obviously, system management errors are basically derived from the operating system. In particular, due to eternity and uncertainty of the delay, disturbances from the process scheduling/thread scheduling should be the main cause of the system management errors. Therefore, for reliability of the CNC system, the real-time operating system likes the sword of Damocles.
As is known, for numerical control of a mechanical system, so-called real-time control is to control relevant axes, and to compose a tool-path.
TABLE 1Δt1Δt2. . .Δti. . .ΔtnΔX1ΔX2. . .ΔXi. . .ΔXnΔy1Δy2. . .Δyi. . .ΔynΔZ1ΔZ2. . .ΔZi. . .ΔZnΔA1ΔA2. . .ΔAi. . .ΔAnΔB1ΔB2. . .ΔBi. . .ΔBn
In general, the five axes are given simple names such as X, y, Z, A, B, and the tool-path is a function of the five variables X, y, Z, A, B. In the Table 1, the coordinate value increments (briefly, denoted as increments) received by five servo drivers are listed according to the time sequence.
The time T is divided into n discrete intervals: Δt1, . . . , Δtn, the increments of X, y, Z, A, B in the interval Δti are ΔXi, Δyi, ΔZi, ΔAi, ΔBi.
In the existing open CNC system based on the IEEE definition, Δt1, . . . , Δtn are time-sharing cycle of real-time operating systems and have equal length, known as the interpolation cycle. Under the control of a real-time operating system, the micro-segment ΔLi (ΔXn, Δyn, ΔZn, ΔAn, ΔBn) is calculated by an iterative interpolation control algorithm in Δti, there i=1, . . . , n. For example, in order to produce the resultant displacement ΔL1, the micro-segment ΔL1 (ΔX1, Δy1, ΔZ1, ΔA1, ΔB1) are calculated in the interpolation cycle Δt1, and are sent into the servo drivers X, y, Z, A, B in a communication cycle of the fieldbus; ΔX1, Δy1, ΔZ1, ΔA1, ΔB1 are fed in a sampling cycle of the servo drivers; then the Δt2 starts, until Δtn, and the resultant displacement ΔLn is produced, and so on.
Here, the real time process includes three aspects:
1. The real-time operating system calculates five increments of the axes X, y, Z, A, B in an interpolation cycle;
2. The increments are sent into the five servo drivers X, y, Z, A, B in a communication cycle of the fieldbus;
3. The five increments are fed in a sampling cycle of the servo drivers.
In the data flow related control, under control of Δt1, . . . , Δtn, the increments received by axes related to a tool-path are called the incremental related data flow of the tool-path. A related data flow with 5-axes linkage is a five dimensions related data flow.
In the data flow related control, All of the intervals Δt1, . . . , Δtn are called the T-division of tool-paths. The Δti, there i=1, . . . , n (briefly, denoted as Δti (i=1, . . . , n)), is called control rhythm, which is different from the interpolation cycle, and their length usually is unequal. All of the micro-segments ΔL1, . . . , ΔLn are called the L-division of tool-paths. The T-division and the L-division are dependent on geometric characteristics of tool-paths and kinematics/dynamics characteristics of axes, and are independent on the control rhythm. The core task of PC systems is decompress digital control information that are compressed in a tool-path and feed rate, and to manufacture the related data flow of the tool-path, i.e. to plan the T-division and the L-division of the tool-path. Thus, the generating processes of the T-division and the L-division become a non real-time process.
The digital image of the L-division generated in a storage space by a given data format is called the linkage-table of the tool-path. The digital image of the T-division generated in a storage space by a given data format is called the follow-table of the tool-path.
Based on L-planning, the L-division of a tool-path is stored as a linkage-table file. According to linkage axes, the linkage-table is divided some axis linkage-tables. For example, the axis linkage-table ΔXi (i=1, . . . , n) of the X-axis, the axis linkage-table Δyi (i=1, . . . , n) of the y-axis, and so on. Further, before machining, if the axis linkage-tables of all axes are distributed to the relevant servo drivers, the distributing process are also non-real-time.
The distributing process of the axis linkage-tables was non-real-time, in order to control linkage of axes, synchronous pulses are sent into the relevant servo drivers designated by the state-word. The synchronous pulses controlled by the state-word are called linkage commands.
Thus, real-time control process of tool-paths is simplified as follows. According to the control rhythm in the follow-table, linkage commands are sent into the servo drivers designated by the state-word; following the linkage commands, the servo drivers write increments in their axis linkage-tables into their position loops, and feed their axes to produce resultant displacements.